﻿using System.Collections.Generic;

namespace Jira
{
    public sealed class JiraConfig
    {
        private readonly string m_Username;
        private readonly string m_Password;

        private readonly int m_MaxNumSearchResults;
        private readonly string m_OpenGrokServer;

        private readonly string m_ExceptionTypeFieldName;
        private readonly string m_MethodTypeFieldName;
        private readonly string m_MethodFieldName;
        private readonly string m_ExceptionReportHashFieldName;
        private readonly string m_EarliestBuildSeenFieldName;
        private readonly string m_LatestBuildSeenFieldName;
        private readonly string m_BuildFixedOnFieldName;
        private readonly string m_AutomaticEmailFieldName;
        private readonly string m_ReportCountFieldName;

        private readonly IEnumerable<string> m_ResolvedStatusNames;
        private readonly IEnumerable<string> m_FixedResolutionNames;

        private readonly string m_CloseActionName;
        private readonly string m_CloseResolutionName;
        private readonly string m_ReopenActionName;

        private readonly string m_ProjectLinkIssueTypeName;
        private readonly string m_BugIssueTypeName;

        public JiraConfig(string username, string password, int maxNumSearchResults, string openGrokServer, string exceptionTypeFieldName, string methodTypeFieldName, string methodFieldName, string exceptionReportHashFieldName, string earliestBuildSeenFieldName, string latestBuildSeenFieldName, string buildFixedOnFieldName, string automaticEmailFieldName, string reportCountFieldName, IEnumerable<string> resolvedStatusNames, IEnumerable<string> fixedResolutionNames, string closeActionName, string closeResolutionName, string reopenActionName, string projectLinkIssueTypeName, string bugIssueTypeName)
        {
            m_Username = username;
            m_Password = password;
            m_MaxNumSearchResults = maxNumSearchResults;
            m_OpenGrokServer = openGrokServer;
            m_ExceptionTypeFieldName = exceptionTypeFieldName;
            m_MethodTypeFieldName = methodTypeFieldName;
            m_MethodFieldName = methodFieldName;
            m_ExceptionReportHashFieldName = exceptionReportHashFieldName;
            m_EarliestBuildSeenFieldName = earliestBuildSeenFieldName;
            m_LatestBuildSeenFieldName = latestBuildSeenFieldName;
            m_BuildFixedOnFieldName = buildFixedOnFieldName;
            m_AutomaticEmailFieldName = automaticEmailFieldName;
            m_ReportCountFieldName = reportCountFieldName;
            m_ResolvedStatusNames = resolvedStatusNames;
            m_FixedResolutionNames = fixedResolutionNames;
            m_CloseActionName = closeActionName;
            m_CloseResolutionName = closeResolutionName;
            m_ReopenActionName = reopenActionName;
            m_ProjectLinkIssueTypeName = projectLinkIssueTypeName;
            m_BugIssueTypeName = bugIssueTypeName;
        }

        public string Username
        {
            get { return m_Username; }
        }

        public string Password
        {
            get { return m_Password; }
        }

        public int MaxNumSearchResults
        {
            get { return m_MaxNumSearchResults; }
        }

        public string OpenGrokServer
        {
            get { return m_OpenGrokServer; }
        }

        public string ExceptionTypeFieldName
        {
            get { return m_ExceptionTypeFieldName; }
        }

        public string MethodTypeFieldName
        {
            get { return m_MethodTypeFieldName; }
        }

        public string MethodFieldName
        {
            get { return m_MethodFieldName; }
        }

        public string ExceptionReportHashFieldName
        {
            get { return m_ExceptionReportHashFieldName; }
        }

        public string EarliestBuildSeenFieldName
        {
            get { return m_EarliestBuildSeenFieldName; }
        }

        public string LatestBuildSeenFieldName
        {
            get { return m_LatestBuildSeenFieldName; }
        }

        public string BuildFixedOnFieldName
        {
            get { return m_BuildFixedOnFieldName; }
        }

        public string AutomaticEmailFieldName
        {
            get { return m_AutomaticEmailFieldName; }
        }

        public string ReportCountFieldName
        {
            get { return m_ReportCountFieldName; }
        }

        public IEnumerable<string> ResolvedStatusNames
        {
            get { return m_ResolvedStatusNames; }
        }

        public IEnumerable<string> FixedResolutionNames
        {
            get { return m_FixedResolutionNames; }
        }

        public string CloseActionName
        {
            get { return m_CloseActionName; }
        }

        public string CloseResolutionName
        {
            get { return m_CloseResolutionName; }
        }

        public string ReopenActionName
        {
            get { return m_ReopenActionName; }
        }

        public string ProjectLinkIssueTypeName
        {
            get { return m_ProjectLinkIssueTypeName; }
        }

        public string BugIssueTypeName
        {
            get { return m_BugIssueTypeName; }
        }
    }
}
